//
//  LOLBasebutton.m
//  LOLXXbox
//
//  Created by mac on 16/1/27.
//  Copyright © 2016年 Grasstrio. All rights reserved.
//

#import "LOLBasebutton.h"

@implementation LOLBasebutton

+(LOLBasebutton *)baseButtonFrame:(CGRect)frame
                        buttonType:(UIButtonType)buttonType
                       buttonTitle:(NSString *)title
                  buttonTitleColor:(UIColor *)color
                         buttonTag:(NSInteger)tag
                       buttonImage:(UIImage *)image
{
    LOLBasebutton *button = [UIButton buttonWithType:buttonType];
    
    
    button.frame=frame;
    if (title) {
        [button setTitle:title forState:UIControlStateNormal];
    }
    
    if (color) {
        [button setTitleColor:color forState:UIControlStateNormal];
    }
    if (tag) {
        button.tag=tag;
    }
    
    
    if (image)
    {
        if(buttonType==UIButtonTypeCustom)
            [button setImage:image forState:UIControlStateNormal];
        else
            [button setBackgroundImage:image forState:UIControlStateNormal];
        
    }
    
    
    return button;
}



@end
